home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / gui / uberwidgets / skinsplitter.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  2KB  |  61 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. import cgui
  5. from gui.skin import get as skinget
  6. from wx import Colour, SYS_COLOUR_WINDOW
  7. import wx
  8. GetColour = wx.SystemSettings.GetColour
  9.  
  10. class SkinSplitter(cgui.SkinSplitter):
  11.     
  12.     def __init__(self, parent, style):
  13.         cgui.SkinSplitter.__init__(self, parent, style)
  14.         self.UpdateSkin()
  15.  
  16.     
  17.     def SplitHorizontally(self, *a, **k):
  18.         cgui.SkinSplitter.SplitHorizontally(self, *a, **k)
  19.         self.UpdateSkin()
  20.  
  21.     
  22.     def SplitVertically(self, *a, **k):
  23.         cgui.SkinSplitter.SplitVertically(self, *a, **k)
  24.         self.UpdateSkin()
  25.  
  26.     
  27.     def UpdateSkin(self):
  28.         mode = self.SplitMode
  29.         splitskin = None(skinget if mode == wx.SPLIT_HORIZONTAL else 'VerticalSizerBar', None)
  30.         if not splitskin is None:
  31.             if isinstance(splitskin, basestring) or splitskin.lower().strip() == 'native' or not hasattr(splitskin, 'get'):
  32.                 self.SetSashSize(-1)
  33.                 self.SetNative(True)
  34.                 return None
  35.             
  36.         
  37.         try:
  38.             sash_size = int(splitskin.thickness)
  39.         except:
  40.             sash_size = -1
  41.  
  42.         syscol = GetColour(SYS_COLOUR_WINDOW)
  43.         bgs = splitskin.get('backgrounds', { })
  44.         normal = bgs.get('normal', syscol)
  45.         active = bgs.get('active', syscol)
  46.         hover = bgs.get('hover', syscol)
  47.         if not isinstance(normal, Colour):
  48.             normal = syscol
  49.         
  50.         if not isinstance(active, Colour):
  51.             active = syscol
  52.         
  53.         if not isinstance(hover, Colour):
  54.             hover = syscol
  55.         
  56.         self.SetSashSize(sash_size)
  57.         self.SetSplitterColors(normal, active, hover)
  58.         self.SetNative(False)
  59.  
  60.  
  61.